const express = require("express");
const router = new express.Router();
const Entry_exam = require("../modles/entry_exam_schema")
const Mid_exam = require("../modles/mid_exam")
const End_exam = require("../modles/end_exam")
const Student_info = require("../modles/student_info_schema")


router.post("/set_student_info", (req, res) => {
    console.log(req.body)
    try {
        Student_info.create(req.body);
        res.send("数据保存成功")
    } catch (err) {
        res.send("数据有误请按标准格式书写")
    }
})


router.post("/entre_exam", async (req, res) => {
    console.log(req.body)
    try {
        await Entry_exam.create(req.body);
        res.send("数据保存成功")
    } catch (err) {
        res.send("数据有误请按标准格式书写")
    }
})


router.post("/mid_exam", async (req, res) => {
    console.log(req.body)
    try {
        await Mid_exam.create(req.body);
        res.send("数据保存成功")
    } catch (err) {
        res.send("数据有误请按标准格式书写")
    }
})

router.post("/end_exam", async (req, res) => {
    console.log(req.body)
    try {
        await End_exam.create(req.body);
        res.send("数据保存成功")
    } catch (err) {
        res.send("数据有误请按标准格式书写")
    }
})

module.exports = router;